package com.erp.erp_dao.Purchase;

import com.erp.erp_entitys.Customer2.Customer2Entity;
import com.erp.erp_entitys.Purchase.ImgUrl;
import com.erp.erp_entitys.Purchase.Purchase;
import com.erp.erp_entitys.Purchase.PurchaseProcessEntity;
import com.erp.erp_entitys.Purchase.PurchaseVo;
import com.erp.erp_entitys.Purchase.req.PurchaseOrderRestockReq;
import com.erp.erp_entitys.Purchase.req.PurchaseProductIntegrationReq;
import com.erp.erp_entitys.Purchase.req.purchaseSampleStatisticsReq;
import com.erp.erp_entitys.Purchase.res.PurchaseDataVo;
import com.erp.erp_entitys.Purchase.res.PurchaseOrderRestockRes;
import com.erp.erp_entitys.Purchase.res.PurchaseProductIntegrationRes;
import com.erp.erp_entitys.Purchase.res.purchaseSampleStatisticsRes;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface IPurchaseDAO {

    /**
     * 通过实体作为筛选条件查询
     * @param req 实例对象
     * @return 对象列表
     */
    List<Purchase> queryAll(Purchase req);

    int deleteByPrimaryKey(Integer id);

    int insert(Purchase record);

    int insertSelective(Purchase record);

    Purchase selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Purchase record);

    int updateByPrimaryKey(Purchase record);

    /**
     * 获取采购首页分页数据
     * @param vo 查询入参实体
     * @return 采购首页分页数据
     */
    List<PurchaseDataVo> selectPurchasePageList(PurchaseVo vo);

    List<Purchase> selectPurchaseList(PurchaseVo vo);

    List<Purchase> selectByIdList(List<Integer> list);

    int updateBoxStatusByKey(PurchaseVo vo);

    int updateValid(Map<String,Object> map);
    /**
     * 按主键查询采购及关联数据
     * @param id
     * @return
     */
    Purchase selectInfoById(Integer id);

    List<Purchase> isExist(String oddNumber);

    Customer2Entity selectCustomer2ByCode(String code);

    int updateStatus(@Param("bid") String bid, @Param("spStatus") String spStatus);

    ImgUrl selectImgUrlById(Integer id);

    /**
     * 保存采购审批信息
     * @return
     */
    int insertProcess(PurchaseProcessEntity purchaseProcessEntity);

    /**
     * 根据采购订单号查询审批信息
     * @param list
     * @return
     */
    List<PurchaseProcessEntity> getProcessListInfo(List list);

    /**
     * 根据采购单号查询是否已经发起流程
     * @param PurchaseNo
     * @return
     */
    int getProcessCount(String PurchaseNo);

    /**
     * 查询审批人的审批信息
     * @param spr
     * @return
     */
    List<PurchaseProcessEntity> getProcessBySPR(String spr);
    /**
     * 更新
     * @param purchaseProcessEntity
     * @return
     */
    int updateProcess(PurchaseProcessEntity purchaseProcessEntity);

    /**
     * 补货采购订单
     * @return
     */
    List<PurchaseOrderRestockRes> purchaseOrderRestockList(PurchaseOrderRestockReq req);

    /**
     * 采购产品整合
     * @return
     */
    List<PurchaseProductIntegrationRes> purchaseProductIntegrationList(PurchaseProductIntegrationReq req);

    /**
     * 获取采购信息
     * @param purchase 采购实体
     * @return 采购信息
     */
    Purchase getPurchaseInfo(Purchase purchase);
    /**
     * 样品采购付款详情
     * @return
     */
    List<purchaseSampleStatisticsRes> purchaseSampleStatisticsList(purchaseSampleStatisticsReq req);
}